b1=new Button("OK"); add(b1,"North"); b2=new Button("Cancel"); add(b2,"South");
import java.awt.*; class MyFrame extends Frame { Button b1,b2; public MyFrame() { BorderLayout lm=new BorderLayout(); this.setLayout(lm); b1=new Button("OK"); b2=new Button("Cancel"); add(b1,"North"); add(b2,"South"); } } class demo { public static void main(String args[]) { MyFrame frm=new MyFrame(); frm.setSize(400,300); frm.setVisible(true); } }